package org.feiye.studyday21.prictice;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class StudentMap {

	public static void main(String[] args) {
		Map<String, Student> map = new HashMap<String, Student>();
		map.put("jack", new Student("李明", "男", 22));
		map.put("Kitty", new Student("赵灵儿", "女", 23));

		Set<String> keySet = map.keySet();// 得到键集
		Iterator<String> it = keySet.iterator();
		while (it.hasNext()) {
			String key = it.next();
			Student value = map.get(key);
			System.out.println(key + "  " + value);
		}
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..");
		for (String key : keySet) {
			Student value = map.get(key);
			System.out.println(key + value);
		}
	}
}
